package com.charm.watercress

import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.alibaba.android.arouter.facade.annotation.Route
import com.charm.watercress.adapter.ChannelAdapter
import kotlinx.android.synthetic.main.fragment_watercress.*
import me.yokeyword.fragmentation.SupportFragment

/**
 * Created by tools on 2018/1/11.
 */
@Route(path = "/watercress/main")
class WatercressFragment : SupportFragment() {
    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater!!.inflate(R.layout.fragment_watercress, container, false)
    }

    override fun onViewCreated(view: View?, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        initData()
    }

    private fun initData() {
        var chanelList = arrayListOf("电影", "阅读")
        var channelAdapter = ChannelAdapter(childFragmentManager, chanelList)
        pager!!.adapter = channelAdapter
        tab_layout!!.setViewPager(pager)
    }

}